package com.icloud.common.database.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Getter
@Setter
@Builder
@ApiModel(value = "钱包流水对象", description = "钱包流水表")
@TableName("t_wallet_journal")
public class TWalletJournal implements Serializable {
    @ApiModelProperty("主键")
    @EqualsAndHashCode.Include
    @TableId(value="id", type= IdType.AUTO)
    private Long id;

    @ApiModelProperty("前台账号 app_customer.id")
    @TableField("customer_id")
    private Long customerId;

    @ApiModelProperty("订单Id order.id")
    @TableField(value="order_id")
    private Long orderId;

    @ApiModelProperty("流水类型")
    @TableField(value="journal_type")
    private String journalType;

    @ApiModelProperty("交易前余额")
    @TableField(value="before_balance")
    private BigDecimal beforeBalance;

    @ApiModelProperty("交易金额")
    @TableField(value="amount")
    private BigDecimal amount;

    @ApiModelProperty("交易手续费")
    @TableField(value="charges")
    private BigDecimal charges;

    @ApiModelProperty("交易后余额")
    @TableField(value="after_balance")
    private BigDecimal afterBalance;

    @ApiModelProperty("币种")
    @TableField(value="currency")
    private String currency;

    @ApiModelProperty("交易方向")
    @TableField(value="direction")
    private String direction;

    @ApiModelProperty("流水状态")
    @TableField(value="journal_state")
    private String journalState;

    @ApiModelProperty("备注")
    @TableField(value="remark")
    private String remark;

    @ApiModelProperty("创建时间")
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @ApiModelProperty("修改时间")
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @ApiModelProperty("创建人")
    @TableField(value = "created_id")
    private Long createdId;

    @ApiModelProperty("修改人")
    @TableField(value = "updated_id")
    private Long updatedId;
}
